import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.Stroke;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.geom.AffineTransform;

public class AnimationCalculations implements ActionListener {
	private AnimationJPanel ajp;
	private ArmMovement am;
	private int x = 0;
	public AnimationCalculations(AnimationJPanel ajp, ArmMovement am) {
		// TODO Auto-generated constructor stub
		this.ajp = ajp;
		this.am = am;
	}

	@Override
	public void actionPerformed(ActionEvent arg0) {
		// TODO Auto-generated method stub

		System.out.println("IT WORKS!!");
		if (ajp.getMouthColor() == Color.black) {
			ajp.setMouthColor(Color.white);

		} else if (ajp.getMouthColor() == Color.white) {
			ajp.setMouthColor(Color.black);

		}

		//if (input = wave) only left arm has switch. am.setR=1. 1 radian max, 0 initial
		//if(input = happy panda) both have same switch. 1 radian max, 0 initial
		switch (x) {
		case 0:
			x = 1;
			break;
		case 1:
			x = 0;
			break;
			default:
				;
		}
		int y = 0;
		switch (y) {
		case 0:
			y= 1;
			break;
		case 1:
			y = 0;
			break;
			default:
				;
		}

		am.setL(x);
		am.setR(-x);

		ajp.repaint();

		// if color=blue, color=white. if color=white, color=blue....
	}

}
